import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import myclass from './views/class/index.vue'

// 课程
import course1 from "./views/course/index.vue"
import addCourse from "./views/course/addCourse.vue"
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/home',
      component: Home,
      children: [{
        path: '/home',
        name: 'home',
        component: myclass,
      },
      {
        path: '/course1',
        name: 'course1',
        component: course1,
      },
      {
        path: '/addCourse',
        name: 'addCourse',
        component: addCourse,
      },
    ],
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ]
})
